﻿Imports System.Windows.Data
Imports System.Windows
Imports System.Windows.Controls

Public Class ColumnToVisibilityConverter
    Implements IValueConverter

    Public Function Convert(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.Convert
        Dim Col As DataGridColumn = DirectCast(value, DataGridColumn)
        If Not Col Is Nothing Then
            If Col.IsReadOnly And Col.Header <> "nbAnneesDerlt" Then Return Visibility.Visible Else Return Visibility.Hidden
        Else
            Return Nothing
        End If
    End Function

    Public Function ConvertBack(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.ConvertBack
        Throw New NotImplementedException
    End Function
End Class
